package cn.nextProject.controller;

import cn.nextProject.entity.Result;
import cn.nextProject.service.PermissionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class PermissionController {

    @Autowired
    private PermissionService permissionService;

    @GetMapping("/findPermissionByNotIn")
    public Result<?> findPermissionByNotIn(@RequestParam("roleGroupId") Long roleGroupId){
        if (ObjectUtils.isEmpty(roleGroupId)){
            return new Result<>().fail("参数不能为空");
        }

        return new Result<>().success("查询成功",permissionService.findByNotIn(roleGroupId));

    }

}
